<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'display';
if($_RQ['op']=='display'){
	$return['item']=$this->plugin_setting('basic');
	$return['item']['upticket']=$return['item']['upticket']?'已通知注册':'未通知注册';
	$return['item']['apiurl']=SITEROOT.'addons/jy_mayizlb/api.php?id='.$_SESSION['uniacid'];
	$htmls=array(
		'type'=>'look',
		'desc'=>'回调事件',
		'tabs'=>array(
			array('op'=>'display','title'=>'回调事件'),
		),
		'look'=>array(
				array('type'=>'tip','title'=>'
				【温馨提示】：需要蚂蚁链租赁上链接口，【通知注册】之后才回调事件。
				</br>1、https://antchain.antgroup.com/docs/11/190781
				'),
				array('type'=>'copy','title'=>'回调地址','name'=>'apiurl'),
				//array('type' =>'post','name'=>'upticket','op'=>'upticket','title' =>'通知注册','btntitle'=>'点击注册'),
		)
	);
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='upticket'){
	$open=core_setting('open');
	$res=$this->model('model')->upticket();
	if($res['errcode']){
		exi('注册失败！'.$res['errcode'].','.$res['errmsg']);
	}else{
		$basic=$this->plugin_setting('basic');
		$basic['upticket']=1;
		$this->plugin_setting('basic',$basic);
		exi('注册成功！');
	}
}